package com.group.project.hrms.service.impl;

import com.group.project.hrms.entity.RestTimeSettings;
import com.group.project.hrms.mapper.RestTimeSettingsMapper;
import com.group.project.hrms.service.IRestTimeSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class RestTimeSettingsService implements IRestTimeSettingsService {

    @Autowired
    private RestTimeSettingsMapper restTimeSettingsMapper;

    @Override
    public int insertRestTimeSettings(RestTimeSettings restTimeSettings) {
        return restTimeSettingsMapper.insert(restTimeSettings);
    }

    @Override
    public int deleteRestTimeSettings(RestTimeSettings restTimeSettings) {
        return restTimeSettingsMapper.deleteByPrimaryKey(restTimeSettings);
    }

    @Override
    public int updateRestTimeSettings(RestTimeSettings restTimeSettings) {
        return 0;
    }

    @Override
    public RestTimeSettings selectOneRestTimeSettings(RestTimeSettings restTimeSettings) {
        return null;
    }

    @Override
    public RestTimeSettings selectOneRestTimeSettingsByRestTimeId(String rid) {
        Example example = new Example(RestTimeSettings.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("restTimeId" , rid);
        return restTimeSettingsMapper.selectOneByExample(example);
    }

    @Override
    public List<RestTimeSettings> selectAllRestTimeSettings() {
        return restTimeSettingsMapper.selectAll();
    }
}
